/********************************************************************************
 * Copyright (c)2016-2020, ShenZhen WanJiaAn Technology CO.,LTD.
 * All Rights Reserved.
 *
 * File Name     : DevLed.h
 * Author        : joki.zhu
 * Date          : 2019-10-16
 *
 * Record        :
 * 1.Date        : 2019-10-16
 *   Author      : joki.zhu
 *   Modification: Created file
 ********************************************************************************/

#ifndef __DEVLED_H__
#define __DEVLED_H__


#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif /* __cplusplus */

#include <pthread.h>

typedef enum {
	LED_TYPE_RED = 0,
	LED_TYPE_BLUE,
	LED_TYPE_NONE
}LED_TYPE_E;

typedef enum {
    LED_STATE_OFF = 0,
	LED_STATE_ON,
	LED_STATE_BLINK,
	LED_STATE_FAST_BLINK,
	LED_STATE_CROSS_BLINK,
	LED_STATE_UPGRADE,
	LED_STATE_NONE
}LED_STATE_E;

typedef enum {
	LED_LEVEL_LOW = 0,
	LED_LEVEL_MIDDLE,
	LED_LEVEL_HIGH,
	LED_LEVEL_NONE,
}LED_LEVEL_E;

typedef struct {
	char bInit;
	char bEnable;
	
	LED_TYPE_E m_CurLed;
	LED_STATE_E m_State;
	LED_LEVEL_E m_Level;
	
	int m_Loop;
	pthread_t m_Pid;
	pthread_mutex_t m_Lock;
}LED_MODULE_S;

int LedInit(void);
int LedSet(LED_TYPE_E ledType, LED_STATE_E ledState, LED_LEVEL_E ledLevel);
int LedSwitch(int bEnable);
int LedDeinit(void);

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */


#endif /* __DEVLED_H__ */
